Specialized ExpressionPattern classes - #1927
Conversation
|
Where can I see benchmarks comparing with the existing code in master? It would be interesting to see what improvements there are with the gs (Gries-Schneider) tests and with the Rubi package. |
Just to be clear, the goal of this is not to speed up the evaluations, but to split the complicated general pattern match algorithm into pieces that can be debugged separately. So, if we have a rule of the form |
Just to be clear. For the last year or two, you said you wanted to work on Boxing and Form handling. There are these digressions and tangents like this that keep coming up. Okay, somehow you saw this via MakeBoxes, and then wanted to do something to make this clearer. But continuing this at this point is now pushing a bit beyond elucidating the existing code so that it can be used. Just to be clear, there has been a history of, well, I'll just add this improvement without a discussion or understanding of the ways this is typically done, big-picture alternatives. The current approach to pattern matching is one of a couple of approaches. It might be right. But it might not be. The more that is done here, may mean more that may need to be rewritten later should we decide to go a different route in handling pattern matching. This project has suffered greatly from misguided ideas along the lines of working in a myopic fashion like this. Expression caches and implementing triangular meshes for graphics surfaces are two examples. But there are numerous other examples. |
|
@rocky, it is just I went as far I could go with MakeBoxes refactor, without facing other aspects, like parsing, pattern matching, evaluation, or the internal representation of some numeric classes. Look, for instance, at the remaining fails in The first four errors comes from differences in how we represent precision in real numbers, and how we propagate information on how numbers must be formatted. In any case, I am OK with leaving this as a draft for a while, and eventually discarding it if it does not prove useful. |
Ok. Thanks for the update. I'll take a look at it when I can, and perhaps together we can come up with a plan or isolate and contain problems. |
add subtract test
cbe8525 to
76b6bbe
Compare
This PR adds two ingredients to the Pattern refactor:
FixedBlankTupleExpressionPatternandSimpleOrderedExpressionPattern, which avoid dealing with the special code for handling orderless, flat, or oneidentity attributes.As motivation, this is the number of typical patterns created in the definitions object at load time: